import MenuView from '@/layouts/MenuView';
import PageView from '@/layouts/PageView';
import RouteView from '@/layouts/RouteView';
import MainView from '@/layouts/MainView';
import RegionView from '@/layouts/routerView/RegionView';
import PhysicsView from '@/layouts/routerView/PhysicsView';
import VirtualView from '@/layouts/routerView/VirtualView';
import Login from '@/views/login/Login';

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: '登录页',
      hideInMenu: true,
      icon: 'close-square'
    },
    component: Login,
    invisible: true
  },

  // 以下为正确的菜单配置
  {
    path: '/',
    name: 'root',
    meta: {
      title: '根',
      hideInMenu: true,
      icon: 'none'
    },
    component: MainView,
    redirect: '/home',
    invisible: true,
    children: [
      // 菜单一、首页
      {
        path: '/home',
        name: 'home',
        meta: {
          title: '首页',
          icon: 'fa fa-home'
        },
        component: () => import('@/views/home/Home')
      },

      // 菜单二、数据监测
      {
        path: '/monitor',
        name: 'monitor',
        meta: {
          title: '数据监测',
          icon: 'fa fa-tv'
        },
        component: PhysicsView,
        children: [
          {
            path: '/monitor/runtimes',
            name: 'runtimes',
            component: () => import('@/views/monitor/Runtimes'),
            meta: {
              title: '数据监测',
              icon: 'fa fa-thermometer-half'
            }
          },
          {
            path: '/monitor/waveform',
            name: 'waveform',
            component: () => import('@/views/monitor/Waveform'),
            meta: {
              title: '故障录波',
              icon: 'fa fa-microchip'
            }
          }
        ]
      }
    ]
  },

  // --------菜单四 - 档案管理
  {
    path: '/archives',
    name: 'archives',
    meta: {
      title: '档案管理',
      icon: 'fa fa-cubes'
    },
    component: MainView,
    redirect: '/archives/psrs',
    children: [
      {
        path: '/',
        name: '_psrs',
        meta: {
          title: '这个不该显示',
          hideInMenu: true,
          icon: 'none'
        },
        component: VirtualView,
        children: [
          {
            path: '/archives/psrs',
            name: 'psrs',
            component: () => import('@/views/archives/Psrs'),
            meta: {
              title: '电力资源',
              icon: 'fa fa-tags'
            }
          }
        ]
      },
      {
        path: '/',
        name: '_system',
        meta: {
          title: '这个不该显示',
          hideInMenu: true,
          icon: 'none'
        },
        component: PhysicsView,
        children: [
          {
            path: '/archives/terminals',
            name: 'terminals',
            component: () => import('@/views/archives/Terminals'),
            meta: {
              title: '设备档案',
              icon: 'fa fa-tablet'
            }
          }
        ]
      }
    ]
  },

  // --------大菜单 - 系统管理
  {
    path: '/system',
    name: 'system',
    meta: {
      title: '系统管理',
      icon: 'fa fa-wrench'
    },
    component: MainView,
    redirect: '/system/firmware',
    children: [
      {
        path: '/',
        name: '_system',
        meta: {
          title: '这个不该显示',
          hideInMenu: true,
          icon: 'none'
        },
        component: RegionView,
        children: [
          {
            path: '/system/region',
            name: 'region',
            component: () => import('@/views/system/RegionCrud'),
            meta: {
              title: '组织机构',
              icon: 'fa fa-users'
            }
          },
          {
            path: '/system/user',
            name: 'user',
            // component: () => import('@/views/system/User'),
            component: () => import('@/views/archives/psrs/LineCrud'),
            meta: {
              title: '系统用户',
              icon: 'fa fa-user-o'
            }
          }
        ]
      }
      // 固件资源暂时不开发
      // {
      //   path: '/system/firmware',
      //   name: 'firmware',
      //   meta: {
      //     title: '固件资源',
      //     icon: 'fa fa-files-o'
      //   },
      //   component: () => import('@/views/system/FirmwareCrud')
      // }
    ]
  }

  // 其他有用的菜单
  // {
  //   path: '/exception',
  //   name: 'exception',
  //   meta: {
  //     title: '异常页',
  //     icon: 'warning'
  //   },
  //   component: RouteView,
  //   children: [
  //     {
  //       path: '/exception/404',
  //       name: '404',
  //       component: () => import('@/pages/exception/404'),
  //       meta: {
  //         title: '404',
  //         icon: 'close-square'
  //       }
  //     },
  //     {
  //       path: '/exception/403',
  //       name: '403',
  //       component: () => import('@/pages/exception/403'),
  //       meta: {
  //         title: '403',
  //         icon: 'close-square'
  //       }
  //     },
  //     {
  //       path: '/exception/500',
  //       name: '500',
  //       component: () => import('@/pages/exception/500'),
  //       meta: {
  //         title: '500',
  //         icon: 'close-square'
  //       }
  //     }
  //   ]
  // }
];
